import { defHttp } from "@/utils/http";

// ERP 药品使用 VO
export interface DrugUseVO {
	id: number; // 唯一标识
	drugCode: number; // 药品编码
}

// ERP 药品使用 API
export const DrugUseApi = {
	// 查询药品使用分页
	getDrugUsePage: async (params: any) => {
		return await defHttp.get({ url: `/whs/drug-usage/page`, params });
	},

	// 查询药品使用详情
	getDrugUse: async (id: number) => {
		return await defHttp.get({ url: `/whs/drug-usage/get?id=` + id });
	},

	// 新增药品使用
	createDrugUse: async (data: DrugUseVO) => {
		return await defHttp.post({ url: `/whs/drug-usage/create`, data });
	},

	// 修改药品使用
	updateDrugUse: async (data: DrugUseVO) => {
		return await defHttp.put({ url: `/whs/drug-usage/update`, data });
	},

	// 删除药品使用
	deleteDrugUse: async (id: number) => {
		return await defHttp.delete({ url: `/whs/drug-usage/delete?id=` + id });
	},

	// 导出药品使用 Excel
	exportDrugUse: async (params: any) => {
		return await defHttp.download({ url: `/whs/drug-usage/export-excel`, params });
	}
};
